package com.mike.service;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * @Description
 * @Date 2021/11/30 14:00
 * @Created by mike
 */
@FeignClient(value = "spring-cloud-service-code",path = "/code")
public interface CodeServiceFeignClient {

    /**
     * ⽣成验证码并发送到对应邮箱，成功true，失败false
     */
    @GetMapping("/create/{email}")
    Boolean createCode(@PathVariable String email);

    /**
     * 校验验证码是否正确，0正确1错误2超时
     */
    @GetMapping("/validate/{email}/{code}")
    Integer validateCode(@PathVariable String email,@PathVariable String code);

}
